package com.cskaoyan.shopping.converter;

import com.cskaoyan.shopping.dal.entitys.Categories;
import com.cskaoyan.shopping.dal.entitys.ItemCat;
import org.springframework.stereotype.Component;

@Component
public class CatCategoriesConverter {

    public static Categories item2Dto(ItemCat cat){

        Categories categories = new Categories();

        categories.setId(cat.getId());
        categories.setIsParent(cat.getIsParent());
        categories.setName(cat.getName());
        categories.setParentId(cat.getParentId());
        categories.setIconUrl(cat.getIcon());
        return categories;
    }
}
